home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 314 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: news.uni-stuttgart.de!schweikh
  2. From: schweikh@itosun.ito.uni-stuttgart.de (Jens Schweikhardt)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: prefix vs. postfix
  5. Date: 4 Jan 1996 09:52:01 GMT
  6. Organization: Comp.Center (RUS), U of Stuttgart, FRG
  7. Message-ID: <4cg801$1f8u@info4.rus.uni-stuttgart.de>
  8. References: <00001a80+00006591@msn.com> <4cegko$20s@ixnews5.ix.netcom.com>
  9. NNTP-Posting-Host: itosun.ito.uni-stuttgart.de
  10.  
  11. In article <4cegko$20s@ixnews5.ix.netcom.com>,
  12. Andrew Snyder <a1s@ix.netcom.com> wrote:
  13. >RNorman@msn.com (Richard Norman) wrote:
  14. >
  15. >>Am I the only one in the world who writes loops as:
  16. >>    for (i=0; i<i_max; ++i) ...?
  17. >>        
  18. >>Note the prefix, ++i.  Virtually all the program examples I see
  19. >>use the postfix, i++.
  20.  
  21. No, you are not the only one. I use ++i too,
  22. years ago I was programming in assembler,
  23. I find it helpful to read '++' as 'increment'
  24. and '--' as 'decrement'. Even if you are scared
  25. by such techno-babble, pronounce '++' as 'add one to'
  26. and you know why I have difficulties parsing i++.
  27. Which reads "I add one to." "You add to what?" :-)
  28.  
  29. I don't have my K&R handy, but could it be the examples
  30. there mostly use i++ when only the side effects are
  31. wanted?
  32.  
  33. Bye, Jens
  34. -- 
  35. SIGSIG -- signature too long (core dumped)
  36.